<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!doctype html>
<html lang="en">
<head>
    <%@include file="/WEB-INF/pages/common/head.jsp"%>
</head>
<body>
<div class="container-fluid">
    <div class="panel panel-info">
        <div class="panel-heading">
            <h4>查询条件</h4>
            <a class="caret pull-right" data-toggle="collapse" href="#content"></a>
        </div>
        <div id="content" class="panel-collapse collapse in">
            <div class="panel-body">
                <form id="condition"  class="form-inline">
                    <div class="row">
                        <div class="panel-group col-md-4">
                            <label for="loginName">物资名称:</label>
                            <input type="text" id="loginName" name="cgName" class="form-control" placeholder="物资名称"/>

                        </div>
                        <div class="panel-group col-md-4">
                            <label for="userName">助记码:</label>
                            <input type="text" id="userName" name="inputCode" class="form-control" placeholder="助记码"/>
                        </div>
                        <div class="panel-group col-md-4">
                            <label for="role">所属院区:</label>
                            <select class="form-control" id="role" name="branchCode">
                                <option value="">请选择</option>
                                <c:forEach items="${branchs}" var="branch">
                                    <option value="${branch.branchCode}">${branch.branchName}</option>
                                </c:forEach>
                            </select>
                        </div>
                    </div>
                    <div class="row">

                        <div class="panel-group col-md-4">
                            <label for="branch">所属仓库:</label>
                            <select class="form-control" id="branch" name="warehouseCode">
                                <option value="">请选择</option>
                                <c:forEach items="${warehouses}" var="d">
                                    <option value="${d.warehouseCode}">${d.warehouseName}</option>
                                </c:forEach>
                            </select>
                        </div>
                        <div class="panel-group col-md-4">
                            <label for="department">物资类别:</label>

                            <select  class="form-control" id="department" name="sortCode" >
                                <option value="">请选择</option>
                                <option value="1001">医疗器械</option>
                            </select>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-md-10"></div>
                        <div class="col-md-2">
                            <button class="btn btn-primary" type="button" onclick="searchTjMaterial()">查询</button>
                            <button class="btn btn-primary" type="button" onclick="addMaterial()">新增</button>
                        </div>

                    </div>

                </form>
            </div>
        </div>
    </div>
    <div id="toolbar">
        <button class="btn btn-success" type="button" onclick="exportFile('pdf')"><i class="glyphicon glyphicon-export"></i>PDF预览</button>
        <button class="btn btn-danger" type="button" onclick="exportFile('xls')"><i class="glyphicon glyphicon-export"></i>导出Excel</button>
    </div>
    <table id="table" data-toggle="table"
           data-pagination="true"
           data-side-pagination="server"
           data-url="base/whCgMapping/searchByWhCgMappingPager"
           data-align="center"
           data-toolbar-algin="right"
           data-toolbar="#toolbar"
    >
        <thead>
        <tr>
            <th data-field="whCgMappingId">序号</th>
            <th data-field="cgCode">物资编号</th>
            <th data-field="cgName">物资名称</th>
            <th data-field="goodsSort.sortName">物资类别</th>
            <th data-field="branch.branchName">所属院区</th>
            <th data-field="warehouse.warehouseName">所属仓库</th>
            <th data-formatter="FormatOperation">操作</th>
        </tr>
        </thead>
    </table>
</div>

<div class="hidden" id="UpMaterial">
    <form id="updateMaterial"  class="form-horizontal">
        <div class="row">

            <div class="form-group col-md-6">
                <label for="">物资名称:</label>
                <input type="text"  name="cgName" class="form-control" disabled="disabled"/>
                <input type="text"  name="whCgMappingId" class="hidden"/>
            </div>
            <div class="form-group col-md-6">
                <label for="">物资编码:</label>
                <input type="text"  name="cgCode" class="form-control"  disabled="disabled"/>
            </div>

        </div>
        <div class="row">
            <div class="form-group col-md-6">
                <label for="">所属院区:</label>
                <select class="form-control" name="branchCode">
                    <c:forEach items="${branchs}" var="branch">
                        <option value="${branch.branchCode}">${branch.branchName}</option>
                    </c:forEach>
                </select>
            </div>
            <div class="form-group col-md-6">
                <label for="">所属仓库:</label>
                <select class="form-control" name="warehouseCode">
                    <c:forEach items="${warehouses}" var="d">
                        <option value="${d.warehouseCode}">${d.warehouseName}</option>
                    </c:forEach>
                </select>
            </div>
        </div>
        <div class="row">
               <div class="form-group col-md-6">
                <label for="">物资类别:</label>
                <select  class="form-control" name="sortCode" >
                    <c:forEach items="${goodsSorts}" var="d">
                        <option value="${d.sortCode}">${d.sortName}</option>
                    </c:forEach>
                </select>
            </div>
        </div>



    </form>
</div>

<div class="hidden" id="AddMaterial">
    <div class="container-fluid">
        <div class="panel panel-info">
            <div class="panel-heading">
                <h4>查询条件</h4>
                <a class="caret pull-right" data-toggle="collapse" href="#content1"></a>
            </div>
            <div id="content1" class="panel-collapse collapse in">
                <div class="panel-body">
                    <form id="condition1"  class="form-inline">
                        <div class="row">
                            <div class="panel-group col-md-6">
                                <label for="cgName">物资名称:</label>
                                <input type="text" id="cgName" name="cgName" class="form-control"/>

                            </div>
                            <div class="panel-group col-md-6">
                                <label for="cgCode">物资编码:</label>
                                <input type="text" id="cgCode" name="cgCode" class="form-control"/>
                            </div>
                        </div>


                        <div class="row">
                            <div class="panel-group col-md-6">
                                <label for="inputCode">助记码:</label>
                                <input type="text" id="inputCode" name="inputCode" class="form-control"/>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-md-10"></div>
                            <div class="col-md-2">
                                <button class="btn btn-primary" type="button" onclick="searchTjDictionary()">查询</button>
                            </div>

                        </div>

                    </form>
                </div>
            </div>
        </div>

        <table id="table1" data-toggle="table"
               data-pagination="true"
               data-side-pagination="server"
               data-url="base/dictionary/searchByDictionaryPager"
               data-align="center"
        >
            <thead>
            <tr>
                <th data-radio="true"></th>
                <th data-field="dictionaryId">序号</th>
                <th data-field="cgCode">物资编码</th>
                <th data-field="cgName">物资名称</th>
                <th data-field="spec">最小规格</th>
                <th data-field="packUnit">包装单位</th>
                <th data-field="factory" >生产厂家</th>
                <th data-field="sortCode" class="hidden"></th>
                <th data-field="branchCode"  class="hidden"></th>
                <th data-field="warehouseCode"  class="hidden"></th>
            </tr>
            </thead>
        </table>
    </div>



</div>
<%@include file="/WEB-INF/pages/common/modal.jsp"%>
<script src="res/js/material.js"></script>
</body>
</html>